package com.zut.service.impl;

import com.zut.dao.AdminShopDao;
import com.zut.dao.impl.AdminShopDaoImpl;
import com.zut.pojo.PageInfo;
import com.zut.pojo.Shop;
import com.zut.service.AdminShopService;
import com.zut.vo.ShopVo;

import java.util.List;

/**
 * @author 张晨
 * @date 2024/9/12 21:56
 * @desc
 */
public class AdminShopServiceImpl implements AdminShopService {
    private AdminShopDao adminShopDao = new AdminShopDaoImpl();

    @Override
    public PageInfo<ShopVo> selectAll(Shop shop, Integer currentPage, Integer pageSize) {
        List<ShopVo> shopVos = adminShopDao.selectAll(shop, currentPage, pageSize);
        Long total = adminShopDao.selectAllCount(shop);

        PageInfo<ShopVo> shopVoPageInfo = new PageInfo<>();
        shopVoPageInfo.setList(shopVos);
        shopVoPageInfo.setTotal(total);

        return shopVoPageInfo;
    }
}
